package com.polaris.live.ui.backpack

import android.os.Bundle
import com.polaris.live.ui.backpack.fragment.ShoppingMallFragment
import com.polaris.live.interface_bag.ShoppingCallBack
import com.polaris.live.R
import com.polaris.live.common.mvvm.base2.BaseVbActivity
import com.polaris.live.common.mvvm.viewmodel.BaseViewModel
import com.polaris.live.common.util.ImmersionBarBuilder
import com.polaris.live.databinding.ActivityShoppingmallBinding
import com.polaris.live.utils.fragment.attachFragment
import com.polaris.live.utils.route.RoutePath
import com.polaris.live.utils.route.Router

/**
 * 商城activity
 * @author Created by 天晴 on 2024/7/23 9:50
 * @since 1.0.0
 **/
class ShoppingMallActivity : BaseVbActivity<BaseViewModel, ActivityShoppingmallBinding>(), ShoppingCallBack {

    override fun ImmersionBarBuilder.buildImmersionBar() {
        setTitleBar(mBinding.barView)
        attachImmersionBar { transparentBar() }
    }

    private val mFragment: ShoppingMallFragment by lazy {
        supportFragmentManager.attachFragment(R.id.frame_layout) {
            ShoppingMallFragment()
        }
    }

    override fun initView(savedInstanceState: Bundle?) {
        mFragment.setOnShoppingCallBack(this)
    }

    override fun buySuccess(type: Long) {
    }

    override fun toLook(type: Long) {
        Router.builder(RoutePath.BACKPACK_ACTIVITY)
            .withLong("decorationType", type)
            .navigation(this)
    }
}